import java.io.*;

public class BufferedStreamDemo01 {
    public static void main(String[] args) throws IOException {
        BufferedWriter bw = new BufferedWriter(new FileWriter("MyFile\\src\\tmp\\bw.txt"));
        bw.write("Hello\n");
        bw.write("world ");
        bw.write("apple");
        bw.close();

        BufferedReader br = new BufferedReader(new FileReader("MyFile\\src\\tmp\\bw.txt"));
        char [] chs = new char[1024];
        int len;
        while((len = br.read(chs)) != -1)
            System.out.println(new String(chs,0,len));
        br.close();
    }
}
